package com.erbao.gc;

/**
 * @author CaoBaoYin
 * @since 2022/4/19 16:37
 */
public class HelloFiber {

    public static void main(String[] args) {
        /*long start = System.currentTimeMillis();

        for (int i = 0; i < 100_00; i++) {
            Fiber<Void> fiber = new Fiber<>(new SuspendableRunnable() {
                @Override
                public void run() throws SuspendExecution, InterruptedException {
                    calc();
                }
            });
            fiber.start();

            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    calc();
                }
            });
            thread.start();
        }


        long end = System.currentTimeMillis();
        System.out.println(end - start);*/
    }

    static void calc(){
        int result = 0;
        for (int i = 0; i < 100_00; i++) {
            for (int j = 0; j < 200; j++) {
                result += j;
            }
        }
    }

}
